package com.yh.workbill.ui.me;

import com.yh.workbill.model.WorkBillCount;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class MeViewModel extends ViewModel {

    private MutableLiveData<String> phoneData;
    private MutableLiveData<WorkBillCount> workBillCountData;

    public MutableLiveData<String> getPhone() {
        if (phoneData == null) {
            phoneData = new MutableLiveData<>();
            phoneData.setValue("");
        }
        return phoneData;
    }

    public void setPhone(String phone) {
        phoneData.postValue(phone);
    }

    public MutableLiveData<WorkBillCount> getWorkBillCountData() {
        if (workBillCountData == null) {
            workBillCountData = new MutableLiveData<>();
            workBillCountData.setValue(new WorkBillCount(0, 0));
        }
        return workBillCountData;
    }

    public void setWorkBillCountData(WorkBillCount workBillCount) {
        workBillCountData.postValue(workBillCount);
    }
}